package org.budo.weixin.event;

import org.budo.weixin.message.EventMessage;

/**
 * @author li
 * @version 1 (2015年11月27日 下午1:10:09)
 * @since Java7
 */
public class TemplateSendJobFinishEvent extends EventMessage {
    private static final long serialVersionUID = 6212779290557821571L;

    private String status;

    public String getEvent() {
        return EventType.TEMPLATE_SEND_JOB_FINISH;
    }

    public String getStatus() {
        return this.status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String toXml() {
        return "<xml>"//
                + "<ToUserName><![CDATA[" + this.getTo() + "]]></ToUserName>"//
                + "<FromUserName><![CDATA[" + this.getFrom() + "]]></FromUserName>"//
                + "<CreateTime>" + this.getCreateTime() + "</CreateTime>"//
                + "<MsgType><![CDATA[" + this.getType() + "]]></MsgType>"//
                + "<Event><![CDATA[" + this.getEvent() + "]]></Event>"//
                + "<EventKey><![CDATA[" + this.getEventKey() + "]]></EventKey>"//
                + "<Status><![CDATA[" + this.getStatus() + "]]></Status>"//
                + "</xml>";
    }

    @Override
    public String toString() {
        return super.toString() + ", from=" + this.getFrom() + ", to=" + this.getTo();
    }
}